from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic.list import ListView
from core.models.subject import Subject
from django.contrib import admin


admin.autodiscover()

urlpatterns = patterns('chtozadali.core.views',
    url(r'^$', "main.get_main"),
    url(r'^profile/', "user.get_profile"),
    url(r'^profile(\d)+/', "user.get_profile"),
    url(r'^login/', "user.log_in"),
    url(r'^logout/', "user.log_out"),
    url(r'^registration/', "user.registration"),
    
    #url(r'^task/week/page/(\d+)$', 'task.get_task_by_week'),
    #url(r'^task/week/page/(?P<page>\d*)$', 'task.get_task_by_week'),
    #url(r'^task/day/$', 'taskforday.get_taskforday'),
    #url(r'^task/id/(\d*)$', 'task.get_task_by_id'),
    #url(r'^task/subject/(\d+)/page/(\d+)$', 'task.get_task_by_subject'),
    url(r'^tasks/$', 'task.list_tasks'),
    url(r'^tasks/to_day/$', 'task.list_tasks_to_day'),
    url(r'^tasks/subject/(\d+)/$', 'task.list_tasks_by_subject'),
    url(r'^tasks/to_day/(?P<day>\d+)/$', 'task.list_tasks_to_day'),
    url(r'^tasks/from_day/$', 'task.list_tasks_from_day'),
    url(r'^tasks/from_day/(?P<day>\d+)/$', 'task.list_tasks_from_day'),
    url(r'^task/(?P<task_id>\d+)/$', 'task.detail_task'),
    url(r'^task/add/$', 'task.add_task'),
    url(r'^tasks/subject/(\d+)/$', 'task.list_tasks_by_subject'),

    url(r'^groups/$', 'groups.get_all_groups'),
    url(r'^groups/my/$', 'groups.get_user_groups'),
    url(r'^group/add/$', 'groups.add_group'),
    url(r'^group/id(\d+)/$', 'groups.get_group_profile'),
    url(r'^group/id(\d+)/enter/$', 'groups.enter_to_group'),
    url(r'^group/id(\d+)/exit/$', 'groups.exit_from_group'),
    url(r'^group/id(\d+)/edit/$', 'groups.edit_group'),
    
    url(r'^api/$', 'api.get_main'),
    url(r'^api/user/exists$', 'api.get_user_exists'),
    url(r'^api/task/done$', 'api.change_task_done'),

    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),

    
    # url(r'^$', 'main.get_main'),
    # url(r'^schedule$', 'schedule.get_schedule'),
    # url(r'^class$', 'class_.get_class'),
    
    # url(r'^cabinet$', 'cabinet.get_cabinet'),
    # url(r'^cabinet/add$', 'cabinet.add_cabinet'),
    # url(r'^cabinet/all$', 'cabinet.get_all_cabinets'),
    # url(r'^chtozadali/', include('chtozadali.foo.urls')),
)

urlpatterns += staticfiles_urlpatterns()
